<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>商家</title>
    <link href="../css.min/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="../css/common.css" />
</head>
<body>
	<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
		<div class="mui-scroll">
			<ul class="mui-table-view mui-table-view-chevron">
				<li class="mui-table-view-cell">
					<a class="mui-navigate-right" title="柯达佳美冲印店" address="宁波鄞州南门小市场内部">
						<img class="mui-media-object mui-pull-left" src="http://7xp9yg.com1.z0.glb.clouddn.com/keda.jpg">
						<div class="mui-media-body">
							柯达佳美冲印店
							<p class='mui-ellipsis'><span class="mui-badge mui-badge-danger">自取</span><span class="mui-badge mui-badge-purple">惠</span>&nbsp;宁波鄞州南门小市场内部</p>
						</div>
					</a> 
				</li>
				<li class="mui-table-view-cell">
					<a class="mui-navigate-right" title="数码摄影冲印中心" address="宁波江东朝晖路">
						<img class="mui-media-object mui-pull-left" src="http://7xp9yg.com1.z0.glb.clouddn.com/smsy.jpg">
						<div class="mui-media-body">
							数码摄影冲印中心
							<p class='mui-ellipsis'><span class="mui-badge mui-badge-danger">送上门</span>&nbsp;宁波江东朝晖路</p>
						</div>
					</a> 
				</li>
				<li class="mui-table-view-cell">
					<a class="mui-navigate-right" title="新天地数码摄影" address="合肥市庐阳区北一环路168号">
						<img class="mui-media-object mui-pull-left" src="http://7xp9yg.com1.z0.glb.clouddn.com/hfxtd.jpg">
						<div class="mui-media-body">
							新天地数码摄影
							<p class='mui-ellipsis'><span class="mui-badge mui-badge-danger">快递</span><span class="mui-badge mui-badge-success mui-badge-inverted">&nbsp;冲印7折</span>合肥市庐阳区北一环路168号</p>
						</div>
					</a> 
				</li>
				<li class="mui-table-view-cell">
					<a class="mui-navigate-right" title="晴晴摄影" address="天津市红桥区咸阳北路">
						<img class="mui-media-object mui-pull-left" src="http://7xp9yg.com1.z0.glb.clouddn.com/tjkeda.jpg">
						<div class="mui-media-body">
							晴晴摄影
							<p class='mui-ellipsis'><span class="mui-badge mui-badge-danger">快递</span>&nbsp;天津市红桥区咸阳北路</p>
						</div>
					</a> 
				</li>
				<li class="mui-table-view-cell">
					<a class="mui-navigate-right" title="上海数码冲印店" address="上海市黄浦区茂名南路">
						<img class="mui-media-object mui-pull-left" src="http://7xp9yg.com1.z0.glb.clouddn.com/shsm.jpg">
						<div class="mui-media-body">
							上海数码冲印店
							<p class='mui-ellipsis'><span class="mui-badge mui-badge-danger">快递</span><span class="mui-badge mui-badge-purple">包邮</span>&nbsp;上海市黄浦区茂名南路</p>
						</div>
					</a> 
				</li>
			</ul>
		</div>
	</div>
</body>
<script src="../js.min/mui.min.js"></script>
<script type="text/javascript" src="../js/config.js" ></script>
<script type="text/javascript" src="../js/utils.js" ></script>
<script type="text/javascript" charset="utf-8">
    mui.init({
		pullRefresh: {
			container: '#pullrefresh',
			down: {
				callback: pulldownRefresh
			},
			up: {
				contentrefresh: '正在加载...',
				callback: pullupRefresh
			}
		}
	});
	
	var Pullrefresh=null;
	document.addEventListener("DOMContentLoaded",function(){
		Pullrefresh=document.getElementById("pullrefresh");
		
		mui('.mui-table-view.mui-table-view-chevron').on('tap','a',function(e){
			e.storeName=this.getAttribute("title");
			e.storeAddress=this.getAttribute("address");
			e.storePic=this.querySelector('img').getAttribute("src");
			
			utils.openWindow("store_detail","store_detail.html",
			"slide-in-right",300,false,
			{pic:e.storePic,address:e.storeAddress,storeName:e.storeName});
			
		});
		
	});
	
	mui.plusReady(function(){
		var netInfo=utils.getNetInfo();
		
		if(netInfo.type==0 || netInfo.type==1){
			var imgObj=Pullrefresh.querySelectorAll('img');
			for (var i = 0; i < imgObj.length; i++) {
				var obj=imgObj[i];
				obj.src="../img/load.jpg";
			}
		}
		
		setTimeout(function() {
			mui('#pullrefresh').pullRefresh().pullupLoading();
		}, 1000);
	});
	
	var count = 0;
	function pullupRefresh(){
		setTimeout(function() {
					/*mui('#pullrefresh').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
					var table = document.body.querySelector('.mui-table-view');
					var cells = document.body.querySelectorAll('.mui-table-view-cell');
					for (var i = cells.length, len = i + 20; i < len; i++) {
						var li = document.createElement('li');
						li.className = 'mui-table-view-cell';
						li.innerHTML = '<a class="mui-navigate-right">Item ' + (i + 1) + '</a>';
						table.appendChild(li);
					}*/
			mui('#pullrefresh').pullRefresh().endPullupToRefresh((++count > 1));
		}, 1500);
	}
	
	function pulldownRefresh(){
		setTimeout(function(){
			mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
			mui.toast("一大波商家正在路上...");
		},1000);
		
	}
	
</script>
</html>